<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml" 
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core" 
                xmlns:ui="http://java.sun.com/jsf/facelets" 
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                template="/prot/principal.xhtml">


    <ui:define name="content">  

        <!-- Main bar -->
        <div class="mainbar">

            <!-- Page heading -->
            <div class="page-head">
                <!-- Page heading -->
                <h2 class="pull-left">#{ctrEstadistica.opcionEdicion} Estadistica
                    <!-- page meta -->
                    <span class="page-meta">Mantenimiento</span>
                </h2>


                <!-- Breadcrumb -->
                <div class="bread-crumb pull-right">
                    <a href="../prot/entrada.xhtml"><i class="icon-home"></i> Home</a> 
                    <!-- Divider -->
                    <span class="divider">/</span> 
                    <a href="listEstadisticas.xhtml" class="bread-current">Estadistica</a>
                    <!-- Divider -->
                    <span class="divider">/</span> 
                    <a href="frmEstadistica.xhtml" class="bread-current">#{ctrEstadistica.opcionEdicion}</a>
                </div>

                <div class="clearfix"></div>

            </div>
            <!-- Page heading ends -->



            <!-- Matter -->

            <div class="matter">
                <div class="container">

                    <div class="row">
                        <div class="col-md-12">

                            <div class="widget wred">
                                <div class="widget-head">
                                    <div class="pull-left">Datos de la Estadistica</div>
                                    <div class="widget-icons pull-right">
                                        <a href="#" class="wminimize"><i class="icon-chevron-up"></i></a> 
                                        <a href="#" class="wclose"><i class="icon-remove"></i></a>
                                    </div>
                                    <div class="clearfix"></div>
                                </div>

                                <div class="widget-content">
                                    <div class="padd">



                                        <div class="form profile">



                                            <!-- Nombre -->
                                            <div class="form-group">
                                                <label class="control-label col-lg-3" for="unombre">Fecha de Creacion</label>
                                                <div class="col-lg-6">

                                                    <h:inputText  id="unombre" value="#{ctrEstadistica.estadistica.fechaCreacion}"
                                                                  required="true" requiredMessage="#{msg.camporequerido}" disabled="true"
                                                                  styleClass="form-control" maxlength="100"
                                                                  
                                                                  >
                                                    <f:convertDateTime pattern="yyyy-MM-dd"/>  
                                                    </h:inputText>
                                                    <rich:message for="unombre"  ajaxRendered="true"/>
                                                </div>

                                            </div>
                                            
                                            
                                            

                                                                                     
                                            
                                            
                                            
                                            
                                            <!-- Codigo del Socio -->
                                            <div class="form-group">
                                                <label class="control-label col-lg-3" for="codSocio">Nombre del Socio</label>
                                                <div class="col-lg-6">

                                                    <h:inputText  id="codSocio" value="#{ctrSession.selSocio.nombre}" disabled="true"
                                                                  />
                                                    <h:commandButton  type="submit" style="color: #ffffff"  class="btn btn-danger" value="Buscar"  action="#{ctrEstadistica.verBuscar()}" alt="Buscar" title="Buscar" immediate="true" 
                                                                      disabled="#{(ctrEstadistica.opcionEdicion eq 'Editar')?'true':'false'}"/> 
                                                    <rich:message for="codSocio"  ajaxRendered="true"/>
                                                </div>

                                            </div>
                                            
                                            <h:panelGroup rendered="#{ctrSession.verBuscador}">
                                            <div style="height: auto;width:auto;position: absolute;top: 40%;left:30%;background-color: gray;z-index: 300;bor">
                                                
                                                <h:commandButton  type="submit" style="color: #ffffff;float: right;background-color: #282828;"  class="btn btn-danger" value="X"  action="#{ctrEstadistica.cerrarBuscador()}" immediate="true" /> 
                                                <br/>
                                                <h:inputText  id="codBuscar" value="#{ctrSession.txtbuscar}"
                                                                  required="false" 
                                                                  styleClass="form-control" maxlength="100"
                                                                  />
                                                <h:commandButton  type="submit" style="color: #ffffff"  class="btn btn-danger" value="Buscar"  action="#{ctrEstadistica.buscarSocio()}" alt="Buscar" title="Buscar"  /> 
                                                    
                                                <rich:dataTable value="#{ctrSession.listSociosList}" var="socio" iterationStatusVar="it" id="tbParticipantes" rows="5"
                                                                rowClasses="odd-row, even-row" styleClass="stable" style="width: auto;" >


                                                    <rich:column>
                                                        <f:facet name="header">Codigo</f:facet>
                                                        <h:outputText value="#{socio.codigo}" />
                                                    </rich:column>

                                                    <rich:column>
                                                        <f:facet name="header">Nombre</f:facet>
                                                        <h:outputText value="#{socio.nombre}" />
                                                    </rich:column>

                                                    <rich:column>
                                                        <h:commandButton  type="submit" style="color: #ffffff"  class="btn btn-danger" value="Seleccionar"  action="#{ctrAlquiler.definirSocio(socio)}" alt="Agregar" title="Agregar"  /> 
                                                    </rich:column>

                                                    <f:facet name="footer">
                                                        <rich:dataScroller page="1" />
                                                    </f:facet>
                                                </rich:dataTable>
                                                
                                                
                                            </div>
                                            </h:panelGroup>
                                            
                                            
                                            
                                            <!-- Mes Seleccionado -->
                                            <div class="form-group">
                                                <label class="control-label col-lg-3" for="umes">Mes</label>
                                                <div class="col-lg-6">

                                                   <h:selectOneMenu id="umes" value="#{ctrEstadistica.mesSeleccionado}"
                                                                         required="true" requiredMessage="#{msg.camporequerido}"
                                                                         styleClass="texto"
                                                                         disabled="#{(ctrEstadistica.opcionEdicion eq 'Editar')?'true':'false'}"
                                                                         >

                                                       <f:selectItem itemLabel="ENERO" itemValue="1" />
                                                       <f:selectItem itemLabel="FEBRERO" itemValue="2" />
                                                       <f:selectItem itemLabel="MARZO" itemValue="3" />
                                                       <f:selectItem itemLabel="ABRIL" itemValue="4" />
                                                       <f:selectItem itemLabel="MAYO" itemValue="5" />
                                                       <f:selectItem itemLabel="JUNIO" itemValue="6" />
                                                       <f:selectItem itemLabel="JULIO" itemValue="7" />
                                                       <f:selectItem itemLabel="AGOSTO" itemValue="8" />
                                                       <f:selectItem itemLabel="SEPTIEMBRE" itemValue="9" />
                                                       <f:selectItem itemLabel="OCTUBRE" itemValue="10" />
                                                       <f:selectItem itemLabel="NOVIEMBRE" itemValue="11" />
                                                       <f:selectItem itemLabel="DICIEMBRE" itemValue="12" />
                                                       

                                                        </h:selectOneMenu>
                                                        <rich:message for="mes" ajaxRendered="true"/>
                                                </div>

                                            </div>
                                            
                                            
                                              <!-- Director -->
                                            <div class="form-group">
                                                <label class="control-label col-lg-3" for="udirector">Total Gastado</label>
                                                <div class="col-lg-6">

                                                    <h:inputText  id="udirector" value="#{ctrEstadistica.estadistica.totalGastado}"
                                                                  disabled="true"
                                                                  styleClass="form-control" maxlength="100"
                                                                  />
                                                    
                                                    <rich:message for="udirector"  ajaxRendered="true"/>
                                                </div>

                                            </div>
                                            
                                            




                                            <rich:messages    ajaxRendered="true"/>



                                            <div class="form-group">
                                                <!-- Buttons -->
                                                <div class="col-lg-6 col-lg-offset-1">

                                                    <h:commandButton  type="submit"  class="btn btn-success" value="#{ctrEstadistica.opcionBoton}" action="#{ctrEstadistica.grabar()}" 
                                                                      rendered="#{(ctrEstadistica.opcionEdicion eq 'Editar')?'false':'true'}"
                                                                      /> 
                                                    <h:commandButton  type="submit"  class="btn btn-default"  value="#{msg.cancelar}" action="#{ctrEstadistica.irListado()}" immediate="true" /> 
                                                </div>
                                            </div>     


                                        </div>



                                    </div>
                                </div>



                            </div>


                        </div>


                    </div>

                </div>
            </div>

            <!-- Matter ends -->

        </div>

        <!-- Mainbar ends -->
    </ui:define>
</ui:composition>